﻿using SuperJoe.Framwork.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WWX.Dto.Search;
using WWX.MemberPortal.BLL;

namespace WWX.MemberPortal.Web.Controllers
{
    public class RechargeController: AuthorizationController
    {
        public ActionResult Index()
        {
            return View();
        }

        public JsonResult List(RechargeSearch search, int limit, int pageIndex = 0)
        {
            int results = 0;
            var list = new RechargeBLL().GetPageList(search, ++pageIndex, limit, out results);
            return this.Json(new { results, rows = list.Select(l => new { no = l.No, amount = l.Amount, remark = l.Remark, date = l.Date.ToString(), zamount = l.ZAmount }) }, JsonRequestBehavior.AllowGet);
        }
    }
}